<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script type="text/javascript" src="../../../layuimini-2/lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
    <script type="text/javascript" src="../../../layuimini-2/lib/echarts.min.js"></script>
</head>

<body>
<!-- 为 ECharts 准备一个定义了宽高的 DOM -->
<div id="main" style="width: 600px;height:400px;"></div>


<script>
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);

    $.ajax({
        "url":"/vip/pie.do",
        "data":{},
        "success":function (result){
            console.log(result)
            option = {
                title: {
                    text: '手机号比例',
                    subtext: '',
                    left: 'center'
                },
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    orient: 'vertical',
                    left: 'left'
                },
                series: [
                    {
                        name: 'Access From',
                        type: 'pie',
                        radius: '50%',
                        data: result.data,
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        },
                        roseType: 'sex'
                    }
                ]
            };


            myChart.setOption(option);
        },
        "dataType":"json"
    });



</script>
</body>

</html>